<script setup lang="ts">
import type { ConsultOrderItem } from "@/types/consult";
import { OrderType } from "@/enums";

defineProps<{
  consult?: ConsultOrderItem;
}>()
</script>

<template>
<div class="room-status" v-if="consult">
  <div class="wait" v-if="consult.status === OrderType.ConsultWait">
    已通知医生尽快接诊，24小时内医生未回复将自动退款
  </div>
  <div class="chat" v-if="consult.status === OrderType.ConsultChat">
    <span>咨询中</span>
    <span class="time"
      >剩余时间：<van-count-down :time="consult.countdown * 1000"
    /></span>
  </div>
  <div
    class="end"
    v-if="consult.status === OrderType.ConsultComplete || consult.status === OrderType.ConsultCancel"
  >
    <van-icon name="passed" /> 已结束
  </div>
</div>
</template>
  
<style lang="scss">
.room-status {
  background-color: #fff;
  color: #888;
  padding: 10px;
}
.chat, .time {
  display: flex;
}
</style>